import getConfig from 'next/config'
const { publicRuntimeConfig } = getConfig()
const { NODE_ENV } = publicRuntimeConfig

let server = ''
let usercenter = ''
let goodsserver = ''
let passportadress = ''
let userserver = ''
let passport = ''
let userpersoncenter = ''
let freeplay = ''
let phonepage = ''
let domainUrl = ''
let orgUrl = ''

if (NODE_ENV == 'production') {
  server = '//api8.xubei.com/b'
  usercenter = '//www.xubei.com'
  goodsserver = '//api8.xubei.com'
  passportadress = '//passport.xubei.com'
  userserver = '//user-server.xubei.com'
  passport = '//passport-server.xubei.com'
  userpersoncenter = '//user.xubei.com'
  freeplay = '//common-server.xubei.com'
  phonepage = '//b.xubei.com/forfree'
  domainUrl = 'xubei.com'
  orgUrl = 'xubei.org'
} else if (NODE_ENV == 'PRD') {
  server = '//api8.xubei-prd.com/b'
  usercenter = '//www.xubei-prd.com'
  goodsserver = 'http://api8.xubei-prd.com'
  passportadress = '//passport.xubei-prd.com'
  userserver = '//user-server.xubei-prd.com'
  passport = '//passport-server.xubei-prd.com'
  userpersoncenter = '//user.xubei-prd.com'
  freeplay = '//common-server.xubei-prd.com'
  phonepage = '//b.xubei-prd.com/forfree'
  domainUrl = 'xubei-prd.com'
  orgUrl = 'xubei-prd.org'
} else if (NODE_ENV == 'DEV') {
  server = '//api8.xubei-test.com/b'
  usercenter = '//www.xubei-test.com'
  goodsserver = 'http://api8.xubei-test.com'
  passportadress = '//passport.xubei-test.com'
  userserver = '//user-server.xubei-test.com'
  passport = '//passport-server.xubei-test.com'
  userpersoncenter = '//user.xubei-test.com'
  freeplay = '//common-server.xubei-test.com'
  phonepage = '//b.xubei-test.com/forfree'
  domainUrl = 'xubei-test.com'
  orgUrl = 'xubei-test.org'
} else {
  server = '//api8.xubei-test.com/b'
  usercenter = '//www.xubei-test.com'
  goodsserver = 'http://api8.xubei-test.com'
  passportadress = '//passport.xubei-test.com'
  userserver = '//user-server.xubei-test.com'
  passport = '//passport-server.xubei-test.com'
  userpersoncenter = '//user.xubei-test.com'
  freeplay = '//common-server.xubei-test.com'
  phonepage = '//b.xubei-test.com/forfree'
  domainUrl = 'xubei-test.com'
  orgUrl = 'xubei-test.org'
}

export const SERVER = server
export const USERCENTER = usercenter
export const GOODSSERVER = goodsserver
export const PASSPORTADRESS = passportadress
export const USERSERVER = userserver
export const PASSPORT = passport
export const USERPERSONCENTER = userpersoncenter
export const FREEPLAY = freeplay
export const PHONEPAGE = phonepage
export const DOMAINURL = domainUrl
export const ORGURL = orgUrl
export const TIMEOUTTIME = 50000
export const ContactHref = 'https://cschat-ccs.aliyun.com/index.htm?tntInstId=_1l45OHI&scene=SCE00006146'
